export function download(dataURL: string, filename = 'download') {
  if (!dataURL) {
    throw new Error(`参数 dataURL 值不合法, ${dataURL}`);
  }
  const a = document.createElement("a");
  a.setAttribute('href', dataURL);
  a.setAttribute('download', filename);
  a.dispatchEvent(new MouseEvent('click'));
}